<?php
/**
 * 
 * @author Paolo Bertuzzo
 *
 */
namespace User\Data;

use User\Entity\OrderHeader;

class OrderHeaderDao extends AbstractDao
{
    
    /**
     * 
     * @param integer $customerId
     * @param string $customerFirstName
     * @param string $customerLastName
     * @param string $customerEmail
     * @param string $status
     * @param double $total
     * @param double $vatTotal
     * @param double $totalWithoutVat
     * @param double $shippingTax
     * @param double $date
     * @return \User\Entity\Order
     */
    public function insert($customerId, $customerFirstName, $customerLastName, $customerEmail, $status, $total, $vatTotal, $totalWithoutVat, $shippingTax, $date) 
    {
        $orderHeader = new OrderHeader();
        
        $orderHeader->setCustomerId($customerId);
        $orderHeader->setCustomerFirstName($customerFirstName);
        $orderHeader->setCustomerLastName($customerLastName);
        $orderHeader->setCustomerEmail($customerEmail);
        $orderHeader->setDate($date);
        $orderHeader->setShippingTax($shippingTax);
        $orderHeader->setStatus($status);
        $orderHeader->setTotal($total);
        $orderHeader->setTotalWithoutVat($totalWithoutVat);
        $orderHeader->setVatTotal($vatTotal);
        
    	$this->entityManager->persist($orderHeader);
    	$this->entityManager->flush();
    	
    	return $orderHeader;
    }
    
}

?>